import { VmErr } from "../svm/VmErr";
import { BaseNode } from "./com/BaseNode";
export class LogicNode extends BaseNode {
    constructor(name?: string) {
        super(name ? name : 'Logic')
        this.edit.out = true
        this.type = 'Logic'
        this.outputName = 'line'
        this.bgColor = '#a55b80'
        this.addInput({ key: 'condition' })
        this.refresh()
    }

    verify(): boolean {
        const condition = this.getInput('condition')
        if(condition?.socket?.connection === undefined) {
            throw new VmErr(this.id, this.titleContent+' node condition undefined')
        }
        return true
    }
}